package com.youku
{
   import flash.utils.Dictionary;
   
   public class GlobalService extends Object
   {
      
      public function GlobalService() {
         super();
      }
      
      private static var _serviceContainer:Dictionary;
      
      private static var _init:Number = __init();
      
      private static function __init() : Number {
         var _loc1_:GlobalService = new GlobalService();
         return 0;
      }
      
      public static function addService(param1:String, param2:Object) : void {
         if(_serviceContainer == null)
         {
            _serviceContainer = new Dictionary();
         }
         if(_serviceContainer[param1] != null)
         {
            throw new ArgumentError("A service is already registered for key " + param1);
         }
         else
         {
            _serviceContainer[param1] = param2;
            return;
         }
      }
      
      public static function getService(param1:String) : Object {
         if(_serviceContainer == null)
         {
            return null;
         }
         return _serviceContainer[param1];
      }
      
      public static function removeService(param1:String) : void {
         if(_serviceContainer != null)
         {
            delete _serviceContainer[param1];
         }
      }
   }
}
